﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Inscripcion_materias.BLL;
using System.Data;
using System.Web.Security;

namespace Inscripcion_materias.Estudiante
{
    public partial class InscribirMaterias : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                BLLMaterias materias = new BLLMaterias();
                DataSet ds = new DataSet();
                ds = materias.ConsultarMaterias(this.User.Identity.Name);
                

                if (ds.Tables[0].Rows.Count == 0)
                {
                    lblmensage.Visible = true;
                }
                else
                {
                    GridView1.DataSource = ds;
                    GridView1.DataBind();

                }


            }
            catch (Exception ex)
            {
               // Lblmensaje.Text = "Usuario o contraseña incorrecta " + ex.Message.ToString();
            }
        }

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Response.Redirect("DetalleMateria.aspx?codigo=" + GridView1.SelectedRow.Cells[1].Text + "&nombre=" + GridView1.SelectedRow.Cells[2].Text);
        }

       
    }
}